package io.github.neo.hhcache.command.list;

import io.github.neo.hhcache.core.Command;
import io.github.neo.hhcache.core.HHCache;
import io.github.neo.hhcache.entry.Reply;

/**
 * @author: hhz
 * @create: 2024/7/10
 **/
public class LlenCommand implements Command {
    @Override
    public String name() {
        return "LLEN";
    }

    @Override
    public Reply<?> exec(HHCache cache, String[] args) {
        String key = getKey(args);
        return Reply.integer(cache.llen(key));
    }
}
